home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Text⁄Files / Writeswell Jr. 1.0.2 Master / Writeswell Jr. Source / headers / ObText.h < prev    next >
Text File  |  1992-10-06  |  3KB  |  89 lines

  1. /* ObText.h
  2.  * ©1992 Working Software, Inc.
  3.  * This source code is copyrighted.  Permission is granted to use the Word Services
  4.  * portion of the Writeswell Jr. source code in your own programs, but you 
  5.  * may not distribute the Writeswell Jr. word-processor code as a 
  6.  * commercial product.  If you modify the code, please do not call it 
  7.  * Writeswell Jr. (or Writeswell.)  This will ensure that people understand the 
  8.  * program and don’t have to deal with a number of different versions with 
  9.  * who-knows-what going on in the code.
  10.  * 
  11.  * Writeswell Jr. and Writeswell are trademarks of Working Software, Inc.
  12.  * 26 Dec 91 Mike Crawford
  13.  */
  14.  
  15. #undef HACK_OSPECS            /* (doesn't work) Define this to make it looks like there's two blocks */
  16.  
  17. enum {
  18.     typePString = 'PStr'        /* Descriptor type for a pascal string */
  19. };
  20.  
  21. enum {
  22.     typeTEText = 'TETx'            /* Text in a TextEdit field */
  23. };
  24.  
  25. typedef struct {
  26.     TEHandle    textH;
  27.     short        startPos;        /* Short cuz TE only handles 32k o' text! */
  28.     short        length;
  29.     DescType    propertyCode;
  30. } TETextTokenBody;
  31.  
  32. OSErr DispatchTEText( AEDesc *tokenPtr,
  33.                         AppleEvent *theAppleEventPtr,
  34.                         AppleEvent *replyEventPtr,
  35.                         long refCon );
  36.  
  37. OSErr TETextGetDataHandler( AEDesc *tokenPtr,
  38.                         AppleEvent *theAppleEventPtr,
  39.                         AppleEvent *replyEventPtr,
  40.                         long refCon );
  41.  
  42. OSErr TETextSetDataHandler( AEDesc *tokenPtr,
  43.                         AppleEvent *theAppleEventPtr,
  44.                         AppleEvent *replyEventPtr,
  45.                         long refCon );
  46.  
  47. pascal OSErr TextFromWind(DescType desiredClass,
  48.                             const AEDesc *container,
  49.                             DescType containerClass,
  50.                             DescType form,
  51.                             const AEDesc *selectionData,
  52.                             AEDesc *theToken,
  53.                             long LongInt);
  54.  
  55. pascal OSErr WordFromTEText(DescType desiredClass,
  56.                             const AEDesc *container,
  57.                             DescType containerClass,
  58.                             DescType form,
  59.                             const AEDesc *selectionData,
  60.                             AEDesc *theToken,
  61.                             long LongInt);
  62.  
  63. pascal OSErr CharFromTEText(DescType desiredClass,
  64.                             const AEDesc *container,
  65.                             DescType containerClass,
  66.                             DescType form,
  67.                             const AEDesc *selectionData,
  68.                             AEDesc *theToken,
  69.                             long LongInt);
  70.  
  71. pascal OSErr PropFromTEText(DescType desiredClass,
  72.                             const AEDesc *container,
  73.                             DescType containerClass,
  74.                             DescType form,
  75.                             const AEDesc *selectionData,
  76.                             AEDesc *theToken,
  77.                             long LongInt);
  78.  
  79. pascal OSErr TextPtrToPString( DescType typeCode,
  80.                                 Ptr dataPtr,
  81.                                 Size dataSize,
  82.                                 DescType toType,
  83.                                 long handlerRefCon,
  84.                                 AEDesc *resultPtr );
  85. void MakeTETextTokenBody( WindowPtr wp, TETextTokenBody* tokDataPtr, DescType propCode );
  86. OSErr CreateTextSpecifier( long windowNumber, long textNumber, AEDesc *specPtr );
  87. OSErr CreateWindTextSpec( WindowPtr wp, long textNumber, AEDesc *specPtr );
  88. OSErr CountTextInWind( WindowPtr wp, long *countPtr );
  89.